From 7b21b453ccaafd87f920b2fd39d2d8cf03026c09 Mon Sep 17 00:00:00 2001 From: tsteven4 <13596209+tsteven4@users.noreply.github.com> Date: Fri, 12 May 2023 09:48:24 -0600 Subject: [PATCH] restrict osm timestamps. (#1107) osm consumers may not accept fractional seconds, but all should support whole seconds. osm consumers may not accept time zone designations other than Z, but all should support time zone designation Z. See https://github.com/osmcode/osmium-tool/issues/267 --- osm.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osm.cc b/osm.cc index 91365ef95..1409cc831 100644 --- a/osm.cc +++ b/osm.cc @@ -718,7 +718,8 @@ OsmFormat::osm_waypt_disp(const Waypoint* waypoint) fout->writeAttribute(QStringLiteral("lat"), QString::number(waypoint->latitude, 'f', 7)); fout->writeAttribute(QStringLiteral("lon"), QString::number(waypoint->longitude, 'f', 7)); if (waypoint->creation_time.isValid()) { - fout->writeAttribute(QStringLiteral("timestamp"), waypoint->CreationTimeXML()); + // osm readers don't uniformally support fractional seconds, and may only accept time zone designation Z. + fout->writeAttribute(QStringLiteral("timestamp"), waypoint->creation_time.toUTC().toString(Qt::ISODate)); } if (waypoint->hdop) { -- 2.30.2